# Dockerfile
FROM openjdk:11-jre-slim

# 安装 JMeter 和插件
RUN apt-get update && \
    apt-get install -y curl unzip && \
    curl https://dlcdn.apache.org/jmeter/binaries/apache-jmeter-5.6.3.tgz | tar -xz && \
    mv apache-jmeter-5.6.3 /jmeter && \
    curl -o /jmeter/lib/ext/jmeter-prometheus-plugin-0.7.1.jar \
         https://repo1.maven.org/maven2/io/github/johrstrom/jmeter-prometheus-plugin/0.7.1/jmeter-prometheus-plugin-0.7.1.jar

# 添加测试脚本
#COPY test.jmx /test.jmx

# 暴露 Prometheus 端口
EXPOSE 9270

# 启动命令
#CMD ["/jmeter/bin/jmeter", \
#     "-n", \
#    "-t", "/test.jmx", \
#    "-Jprometheus.port=9270", \
#    "-Jprometheus.ip=0.0.0.0"]